package main

import (
	"GORM_Demo04/part08/MyPojo"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

/*	常用方法

	【11】Delete:删除数据
*/

func main() {
	db, err := gorm.Open("mysql", "root:123456@tcp(192.168.11.189:3306)/lztest?charset=utf8&parseTime=True&loc=Local")

	if err != nil {
		panic(err)
	}
	defer db.Close()

	db.LogMode(true)

	//【10】Update:更新数据

	var user MyPojo.User
	db.Where("uid =?", 1).Delete(&user)

}
